﻿using HDFSViewer.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace HDFSViewer.Converter
{
    public class NodeTypeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            NodeType type = (NodeType)value;
            if (type == NodeType.Directory)
            {
                return @"\View\SmallImage\Directory.png";
            }
            else if (type == NodeType.File)
            {
                return @"\View\SmallImage\File.png";
            }
            else if (type == NodeType.Root)
            {
                return @"\View\SmallImage\Root.png";
            }
            else
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
